#!usr/bin/env python  
# -*- coding:utf-8 _*-
""" 
@author:robot
@file: title005.py 
@version:
@time: 2023/05/13
C68.跳台阶
"""


class Solution1:
    def jumpFloor(self, number: int) -> int:
        # write code here
        if number <= 1:
            return 1
        return self.jumpFloor(number - 1) + self.jumpFloor(number - 2)


import functools


class Solution2:
    @functools.lru_cache
    def jumpFloor(self, number: int) -> int:
        # write code here
        if number <= 1:
            return 1
        return self.jumpFloor(number - 1) + self.jumpFloor(number - 2)


class Solution3:

    def jumpFloor(self, number: int) -> int:
        dp = [0 for i in range(50)]
        # write code here
        dp[0] = 1
        dp[1] = 1
        for i in range(2, number + 1):
            dp[i] = dp[i - 1] + dp[i - 2]
        return dp[number]


class Solution4:
    def jumpFloor(self, number: int) -> int:
        # write code here
        a = 1
        b = 1
        c = 1
        for i in range(2, number + 1):
            c = a + b
            a = b
            b = c
        return c
